/**
 * Created by huhai on 17/7/14.
 */
import "./style.scss"
import barChartTemplate from './template.html'
import template from 'art-template'
import $ from 'jquery'
module.exports = function(ele,data,ifClean = false){
  //check if the ele exists
  let eleDom = document.querySelector(ele)
  if(!eleDom){
    console.warn("没有找到",ele, "请检查")
  }
  if(typeof data !== 'object'){
    console.warn("请传入对象")
    return
  }
  let render = template.compile(barChartTemplate)
  let html = render(data)
  if(!ifClean){
    $(eleDom).append(html)
  }else{
    $(eleDom).html(html)
  }
};

